import java.util.LinkedList;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-25
 * Time: 23:24
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            LinkedList linkedList = new LinkedList<>();
            int  n = scanner.nextInt();
            int a=1;
            int b=2;
            int sum=a+b;
            if(n==1){
                System.out.println(1);
                return;
            }else if (n==2){
                System.out.println(2);
                return;
            }
            for (int i = 3; i <=n; i++) {
                a=b;
                b=sum;
                sum=a+b;

            }
            String str = b+" ";
            if(str.length()>6) {
                for (int i = 0; i <str.length(); i++) {
linkedList.add(str.charAt(i));
                }
                for (int i = 0;i<6;i++) {
                    System.out.println(Integer.parseInt(String.valueOf(linkedList.pollLast())));
                }
            }else {
                System.out.println(b);
            }
        }
    }
}
